import { reqSearchList } from '@/api/search'
export default {
  namespaced: true,
  state: {
    searchList: []
  },
  mutations: {
    // 1.定义存储搜索列表数据的mutation
    addSearchList(state, searchList) {
      state.searchList = searchList
    }
  },
  actions: {
    // 1.搜索页面的action
    async getSearchList(context, params) {
      const res = await reqSearchList(params)
      // console.log(res)
      context.commit('addSearchList', res.data)
    }
  },
  getters: {

  }
}
